<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>对象数据类型</title>
</head>
<body>
<script>
    //创建一个对象
    var obj = {
        name:"cty",
        age:18,
        hobby:"basketball"
    };
    console.log(obj);
    //向对象增加属性
    var cty={};
    cty.name = "cty";
    cty['age'] = 18;
    console.log(cty);
    //删除一个属性
    delete cty.name;
    console.log(cty);
    cty.name = "nihao";
    cty['age'] = 18;
    cty['gender'] = "male";
    console.log(cty);
    cty['age'] = 28;
    console.log(cty);
</script>
</body>
</html>